cleaning up card manager and reworking camera code