Changed constants to functions. Added some TODOs.