Setting up pics controller and pics view with the loop