first version using midnight js