mostly accepts input correctly. takes 0 and odd numbers, which is a problem but fine for now