moved some functions around to be used in other files
updated for new functions
initial version
added res file