initial commit of port to Starling. missing tests for now.