Cleaned out code and added help function