using floor instance of ceil. :'(