Dev version of cleanup() added