cleanup

Moving some constant values around and adding more comments.