Working basic functions but still need refactor