adaptions to pc_app
stop using 'new' and use stack where possible