complete overhaul, ready for package development
delete old files
functions added