Full code review

Full code review
Moved all constants to a settings file with comments.