Code commenting and bug fixes WIP