Non working camera code before complete rewrite.