source code added - attempt 3