Finalize basic algorithm for calculation
Use static example. TODO:Turn to dynamic