initial code form Ricky SCIR