Made the functions nicer