fixed errors - runs fine