animation code taken from Obj C converted to Swift. still has errors but will look at that with Don or max tomorrow