clean up laser calculation code