Still a few bugs to fix