initial commit, slowly porting stuff from sugali...