added init function to location