updated code... Added location manager.