Refactored into seperate programs by type of function.