This is for a school project
Credits to SAN12134, as his code really helped me think things in another angle.