cleaned up source and added option type
added functor