working except for errors