first pieces of code for spatial component