Ported to Linux and added base for MacOSX