Move magic numbers to const defines
Use prevois result for calculate next frame