Worked out some errors