fixed function names, moved sales functions to another file.