cleaned up lab code