Change layout and calc agloritm