Started on writing more useful functions