Fixed typos and wrote more utility functions