added JS calculations