Added code for assigment by rag

hope the code is clear enough for everyone to understand