working stable code.