basic working version

Hey, I needed this for my project, and updated this to a working version - take a look