More tweaks and added more functions