Add better methods, fix bugs and add comments