pre function, unfinished layout