Imported solution for get() function from http://stackoverflow.com/questions/27617924