Try and remember to replace your tabs with the expected number of spaces prior to posting your code.

You've still got that 'floor' in there. As I said before the ONLY thing it does is slow your program down.

To help narrow down the problem try as input the items from 1 to 7 in increasing order, and then try starting with them in decreasing order. Step through the code with that input and you should find the problem.