switched to comparing bools rather then doubles, added some logic to prevent out of bounds possibility