added getpreviousnumber