implement angular; begin code optimization