moved sphere implementation to a separate file