Finished wrapping master function, addressed issue #6