Parameterized for Ubuntu

I made changes so it would work on Ubuntu. I have tested it on 12.04 LTS.