Better REM calculator

Signed-off-by: Colton Fitzgerald <rockincolton@gmail.com>