added #ifdef and changed floor to round