adding source code for third prototype