Added missing file
Cleaned up code, made it more generic and added info to README
Merged with master