added SetHeading, changed Function a bit