openMP added for switch based calculations