Fixed bad method
Added optional logic and tests