cleanup and added test