Edited to cleanup properly