created basic functionality in js