Initial porting of code from google code project