Implemented issue #3

Removed the switch statement that was deciding what function to call and
added a new dynamic method.