cleaned up functions, added new types