fix floor calculation