completed tests and improved return types