creating the pics controller and the pics view loop