calculating area in backend