Added more helper functions, will need to clean this eventually