fixed bugs and spelling