Commons file

Created a commons file, for all common functions