Writing ugly code but hey it works :)
PS: smart math loving high schooler who wishes school didn't exist :(