new base code

should work a lot better