major refactoring, and added comments but in the process broke github posts